#ifndef __HEAD_H__
#define __HEAD_H__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>
#include <pwd.h>
#include <sys/mman.h>
#include <grp.h>
#include <fcntl.h>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <sys/shm.h>
#include <sys/sem.h>
#include <sys/msg.h>
#include <signal.h>
#include <pthread.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <netdb.h>
#include <sys/epoll.h>
#include <mysql/mysql.h>

#define ARGS_CHECK(argc, num){if(argc!=num){fprintf(stderr,"args error!\n"); return -1;}}

#define ERROR_CHECK(ret,num,msg){if(ret == num){perror(msg); return -1;}}

#define PTHREAD_ERROR_CHECK(ret, msg){\
    do{\
        if(0 != ret){\
           printf("%s: %s\n", msg, strerror(ret));\
        }\
    }while(0);\
}

typedef struct{
    int dataLen;
    char buf[1000];
}Train_t;

typedef struct {
    char type;
    long fileSize;
    char fileName[20];
}FileInfo, *pFileInfo;

#endif
